#ifndef SERVICES
#define SERVICES

#include "grpc++/grpc++.h"
#include "../rpc_src/message.grpc.pb.h"
#include "../rpc_src/message.pb.h"
#include <string>
#include <random>
#include <ctime>
#include "redis_pool.h"

#define EXPIRETIME 180
//默认就是获取六位数验证码
std::string generateVerificationCode(int length=6);


class userCenterServices
:public message::userCenter::Service
{
public:
    //获取验证码服务
    virtual ::grpc::Status GetVarifyCode(::grpc::ServerContext* context, const ::message::reqGetVarify* request, ::message::resGetVarify* response);
    //用户注册服务---需要联动userCenterDap层的调用
    virtual ::grpc::Status  RegisterUser(::grpc::ServerContext* context, const ::message::reqRegisterUser* request, ::message::resRegisterUser* response);
    //密码重置
    virtual ::grpc::Status ResetPasswd(::grpc::ServerContext* context, const ::message::reqResetPasswd* request, ::message::resResetPasswd* response);

    //用户登陆
    virtual ::grpc::Status Login(::grpc::ServerContext* context, const ::message::reqLogin* request, ::message::resLogin* response);
    
};


#endif